import PAGES from '../pages.json';

export enum NAVIGATE_TYPE {
  NAVIGATE_TO = 'navigateTo',
  REDIRECT_TO = 'redirectTo',
  RE_LAUNCH = 'reLaunch',
  SWITCH_TAB = 'switchTab',
  NAVIGATE_BACK = 'navigateBack',
}

export const NAVIGATE_TYPE_LIST = ['navigateTo', 'redirectTo', 'reLaunch', 'switchTab'];

export const HOME_PAGE = '/pages/common/Home';
export const LOGIN_PAGE = '/pages/login/index';
export const NOT_FOUND_PAGE = '/pages/notFound/404';

const routes = PAGES.pages.map((e) => {
  return '/' + e.path || '';
});

export enum TabbarPath {
  Home = '/pages/common/Home',
  Classify = '/pages/footer/news/index',
  Account = '/pages/footer/about/index',
}

export enum PATH_COLLECTIONS {
  ORDERMANAGE = '/pages/views/orderManage/orderManage',
  PERSON = '/pages/footer/about/person',
  LOG = '/pages/log/index',
  TAKEPICTURE = '/pages/views/takePicture/index',
  ACTIVITY = '/pages/views/activities/index',
  PUTACTIVITY = '/pages/views/activities/edit',
  APPLYTOKEN = '/pages/views/app/index',
  MAP = '/pages/views/map/index',
  WHEATHER = '/pages/views/wheather/index',
  LIVEPLAYER = '/pages/views/livePlayer/index',
  WEBVIEW = '/pages/common/webview',
  POEM = '/pages/views/poem/search',
  POEMSEARCH = '/pages/views/poem/search',
  PRODUCTVIEW = '/pages/footer/news/productView',
  MQTT = '/pages/views/mqtt/index',
  Login = '/pages/login/index',
  Wanted = '/pages/views/wanted',
}

/**
 * 需要验证登录的路径
 * 包括分包(subPackage)的路径
 */
export const AuthPage: string[] = [
  PATH_COLLECTIONS.LOG,
  PATH_COLLECTIONS.TAKEPICTURE,
  PATH_COLLECTIONS.PERSON,
  PATH_COLLECTIONS.APPLYTOKEN,
  PATH_COLLECTIONS.POEM,
  PATH_COLLECTIONS.ACTIVITY,
];
